import wx
import wx


class MyFrame(wx.Frame):
    def __init__(self, parent, title):
        windonwsize = wx.GetClientDisplayRect()
        size = (windonwsize[2] / 2, windonwsize[3])
        wx.Frame.__init__(self, parent, title=title, size=size)
        self.Center()
        self.pnl = wx.Panel(self)
        self.pnl.BackgroundColour = 'sky blue'
        '''第一层'''
        sizer1 = wx.BoxSizer(wx.HORIZONTAL)
        self.ccrsb = wx.StaticBox(self.pnl, label="客户消费记录")
        self.ccrsbs = wx.StaticBoxSizer(self.ccrsb, wx.HORIZONTAL)
        self.name_text = wx.TextCtrl(self.pnl, -1, size=(70, 20))
        self.phone_text = wx.TextCtrl(self.pnl, -1, size=(70, 20))
        self.amount_text = wx.TextCtrl(self.pnl, -1, size=(70, 20))
        self.ccrsbt = wx.Button(self.pnl, -1, "提交", size=(70, 25))
        # self.pnl.Bind(wx.EVT_BUTTON, self.response_data, self.ccrsbt)
        self.check1 = wx.RadioButton(self.pnl, -1, "类型1", style=wx.RB_GROUP)
        self.check2 = wx.RadioButton(self.pnl, -1, "类型2")
        self.check3 = wx.RadioButton(self.pnl, -1, "类型3")

        sizer1.Add(wx.StaticText(self.pnl, -1, "姓名："), 0, wx.EXPAND)
        sizer1.Add(self.name_text, 1, wx.ALL | wx.EXPAND)
        sizer1.Add(wx.StaticText(self.pnl, -1, "手机号："), 0, wx.EXPAND)
        sizer1.Add(self.phone_text, 1, wx.ALL | wx.EXPAND)
        sizer1.Add(wx.StaticText(self.pnl, -1, "消费金额："), 0, wx.EXPAND)
        sizer1.Add(self.amount_text, 1, wx.EXPAND)
        sizer1.Add(self.check1,0,wx.EXPAND)
        sizer1.Add(self.check2, 0, wx.EXPAND)
        sizer1.Add(self.check3, 0, wx.EXPAND)
        sizer1.Add(self.ccrsbt, 0, wx.EXPAND)

        self.ccrsbs.Add(sizer1, 1, wx.EXPAND | wx.ALL)

        self.lc = wx.ListCtrl(self.pnl, style=wx.LC_REPORT)
        self.lc.InsertColumn(0, "序号")
        self.lc.InsertColumn(1, "手机号")
        self.lc.InsertColumn(2, "返利类型")
        self.lc.InsertColumn(3, "返利金额")
        self.rcsb1 = wx.StaticBox(self.pnl, label="等待返利清单")
        self.rcsbs1 = wx.StaticBoxSizer(self.rcsb1, orient=wx.HORIZONTAL)
        self.rcsbs1.Add(self.lc, 1, wx.EXPAND | wx.ALL)

        self.lc2 = wx.ListCtrl(self.pnl, style=wx.LC_REPORT)
        self.lc2.InsertColumn(0, "序号")
        self.lc2.InsertColumn(1, "手机号")
        self.lc2.InsertColumn(2, "返利类型")
        self.lc2.InsertColumn(3, "返利金额")
        self.rcsb2 = wx.StaticBox(self.pnl, label="可以返利清单")
        self.rcsbs2 = wx.StaticBoxSizer(self.rcsb2, orient=wx.HORIZONTAL)
        self.rcsbs2.Add(self.lc2, 1, wx.EXPAND | wx.ALL)

        self.lc3 = wx.ListCtrl(self.pnl, style=wx.LC_REPORT)
        self.lc3.InsertColumn(0, "序号")
        self.lc3.InsertColumn(1, "手机号")
        self.lc3.InsertColumn(2, "返利类型")
        self.lc3.InsertColumn(3, "返利金额")
        self.rcsb3 = wx.StaticBox(self.pnl, label="已经返利清单")
        self.rcsbs3 = wx.StaticBoxSizer(self.rcsb3, orient=wx.HORIZONTAL)
        self.rcsbs3.Add(self.lc3, 1, wx.EXPAND | wx.ALL)

        self.rcsb = wx.StaticBox(self.pnl, label="返利管理")
        self.rcsbs = wx.StaticBoxSizer(self.rcsb, orient=wx.HORIZONTAL)

        self.returnButton = wx.Button(self.pnl, -1, "返回主菜单")
       # self.rcsbs.Add(self.pnfbs, 0, wx.EXPAND | wx.ALL)
        #  self.rcsbs.Add(self.rnfbs,0, wx.EXPAND|wx.ALL)

        self.rcsbs.Add(self.rcsbs1, 1, wx.EXPAND | wx.ALL)
        self.rcsbs.Add(self.rcsbs2, 1, wx.EXPAND | wx.ALL)
        self.rcsbs.Add(self.rcsbs3, 1, wx.EXPAND | wx.ALL)

        self.boxzer2 = wx.BoxSizer(wx.VERTICAL)
        self.boxzer2.Add(self.rcsbs, 1, wx.EXPAND | wx.ALL, 10)
        self.border = wx.BoxSizer(wx.VERTICAL)
        self.border.Add(self.ccrsbs, 0, wx.EXPAND )
        self.border.Add(self.boxzer2, 1, wx.EXPAND )
        self.border.Add(self.returnButton,0 , wx.EXPAND )
        self.pnl.SetSizer(self.border)



if __name__ == '__main__':
    app = wx.App()
    frm = MyFrame(None, '返利系统')
    frm.Show()
    app.MainLoop()
